# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-ement
pkgver=0.15.1
pkgrel=0
_pkgreal=ement
pkgdesc="Matrix client for Emacs"
url="https://github.com/alphapapa/ement.el"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	cmd:emacs
	emacs-persist
	emacs-plz
	emacs-svg-lib
	emacs-taxy
	emacs-taxy-magit-section
	"
makedepends="emacs-nox"
source="https://github.com/alphapapa/ement.el/archive/v$pkgver/emacs-ement-$pkgver.tar.gz"
builddir="$srcdir/ement.el-$pkgver"

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

check() {
	emacs -batch -q -no-site-file -L . -L tests \
		-l ement-tests -f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/$_pkgreal/

	cd "$pkgdir"/usr/share/emacs/site-lisp/$_pkgreal
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
e884806fef4e55233c3aac0ecfca7c182d1b3064f0674d8537ef48625035fe1a37cd64509221c361ca442ada83f9dfef2d06a7c69bae661417167cd0e4d1e2f4  emacs-ement-0.15.1.tar.gz
"
